import 'package:flutter/material.dart';
import 'items/main_item.dart';
import 'common/app_color_size.dart';

/* 功能 */
class FunctionPage extends StatefulWidget {
  @override
  _FunctionPageState createState() => _FunctionPageState();
}
 
class _FunctionPageState extends State<FunctionPage> {

  void navigateNamed(String routeName){
    Navigator.pushNamed(context, routeName);
  }

  @override
  Widget build(BuildContext context) {
    var items = [
        MainItem(text: '路由', routeName: 'page_router',iconData: Icons.flip, isDone: true,),
        MainItem(text: '状态', routeName: '',iconData: Icons.golf_course),
        MainItem(text: '网络请求Dio', routeName: 'dio_demo',iconData: Icons.golf_course),
        MainItem(text: '数据共享', routeName: 'data_sharing',iconData: Icons.data_usage)
      ];
    return Scaffold(
      // backgroundColor: appPageBgColor,
      appBar: AppBar(
        title: Center(
          child: Text('功能'),
        ),
        elevation: 0.0,
      ),
      body: Container(
        margin: EdgeInsets.all(0.0),
        child: ListView.separated(
          itemCount: items.length,
          itemBuilder: (BuildContext context, int index) {
            return items[index];
          }, 
          separatorBuilder: (BuildContext context, int index) {
            return Divider(color: Colors.grey, indent: 5, endIndent: 5,height: 0.1,thickness:0);
          }, 
        ),
      ),
    );
  }
}
